<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>14-阶段小结实践：购物车案例</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <style>
      * {
        margin: 0;
        padding: 0;
      }
      body {
        padding: 20px;
      }
      a {
        text-decoration: none;
      }
      ul {
        overflow: hidden;
      }
      ul li {
        list-style: none;
      }
      .cart {
        width: 330px;
        height: 360px;
        border: 1px solid #ccc;
        position: relative;
      }
      .my_commodity {
        line-height: 36px;
        background-color: rgb(255, 204, 0);
        text-align: center;
      }
      li {
        padding: 0 15px;
        height: 39px;
        line-height: 39px;
        border-bottom: 1px dashed rgb(255, 204, 0);
      }
      li > div {
        float: left;
      }
      .commodity_l {
        padding-right: 30px;
      }
      .change > input {
        display: inline-block;
        width: 50px;
        height: 22px;
        height: 26px;
        padding-left: 13px;
        border-radius: 5px;
        border: 1px solid rgb(255, 204, 0);
        color: rgb(75, 73, 73);
      }
      .change > a {
        display: inline-block;
        width: 22px;
        height: 22px;
        border-radius: 50%;
        color: hotpink;
        font-weight: bold;
        font-size: 20px;
        line-height: 22px;
        text-align: center;
        background-color: rgb(255, 204, 0);
      }
      .commodity_r {
        float: right;
        width: 26px;
        height: 26px;
        background-color: hotpink;
        border-radius: 3px;
        text-align: center;
        line-height: 23px;
        margin-top: 5px;
        font-weight: bold;
        font-size: 22px;
        cursor: pointer;
      }
      .total {
        width: 100%;
        height: 50px;
        line-height: 50px;
        background-color: rgb(227, 116, 26);
        position: absolute;
        bottom: 0;
        left: 0;
      }
      .sum {
        float: right;
        font-size: 20px;
      }
      .sum > button {
        background-color: #fff;
        border-radius: 5px;
        padding: 6px 9px;
        border: none;
        margin: 0 30px;
        cursor: pointer;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <div class="cart">
        <div class="my_commodity">我的商品</div>
        <ul>
          <li>
            <div class="commodity_l"><span>小米11手机</span></div>
            <div class="change">
              <a href="javascript:;">-</a>
              <input type="text" value="1" />
              <a href="javascript:;">+</a>
            </div>
            <div class="commodity_r">x</div>
          </li>
          <li>
            <div class="commodity_l"><span>小米11手机</span></div>
            <div class="change">
              <a href="javascript:;">-</a>
              <input type="text" value="1" />
              <a href="javascript:;">+</a>
            </div>
            <div class="commodity_r">x</div>
          </li>
          <li>
            <div class="commodity_l"><span>小米11手机</span></div>
            <div class="change">
              <a href="javascript:;">-</a>
              <input type="text" value="1" />
              <a href="javascript:;">+</a>
            </div>
            <div class="commodity_r">x</div>
          </li>
          <li>
            <div class="commodity_l"><span>小米11手机</span></div>
            <div class="change">
              <a href="javascript:;">-</a>
              <input type="text" value="1" />
              <a href="javascript:;">+</a>
            </div>
            <div class="commodity_r">x</div>
          </li>
          <li>
            <div class="commodity_l"><span>小米11手机</span></div>
            <div class="change">
              <a href="javascript:;">-</a>
              <input type="text" value="1" />
              <a href="javascript:;">+</a>
            </div>
            <div class="commodity_r">x</div>
          </li>
          <li>
            <div class="commodity_l"><span>小米11手机</span></div>
            <div class="change">
              <a href="javascript:;">-</a>
              <input type="text" value="1" />
              <a href="javascript:;">+</a>
            </div>
            <div class="commodity_r">x</div>
          </li>
        </ul>
        <div class="total">
          <div class="sum">
            <span>总价：￥88</span>
            <button>结算</button>
          </div>
        </div>
      </div>
    </div>
    <script>
      var vm = new Vue({
        el: '#app',
        data: {},
        methods: {},
      });
    </script>
  </body>
</html>
